<script lang="ts" setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router';
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'

defineProps({
  isCollapse: String,
  likes: Number
})
const router = useRouter();
let isCollapse = ref(false)

const handleOpen = (key: string, keyPath: string[]) => {
  // this.isCollapse = true
  console.log(key, keyPath)

}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const selectItem = (index) => {
  router.push(index)
}
</script>

<template>
  <el-container id="container">
    <el-aside width="250px">
      <el-container id="top">
        <!-- <img style="width:25px;height:25px;margin:auto;margin-right:0;" src="http://www.w3.org/2000/svg" /> -->
        <svg style="width:25px;height:25px;margin:auto;margin-right:0;" xmlns="http://www.w3.org/2000/svg"
          viewBox="0 0 1024 1024">
          <path fill="currentColor"
            d="M598.4 831.872H328.192a256 256 0 0 1-34.496-510.528A352 352 0 1 1 598.4 831.872m-271.36-64h272.256a288 288 0 1 0-248.512-417.664L335.04 381.44l-34.816 3.584a192 192 0 0 0 26.88 382.848z">
          </path>
        </svg>
        <div style="margin:auto;margin-left:10px;font-size:17px">
          AI Weather
        </div>
      </el-container>
      <el-radio-group v-model="isCollapse" style="margin-bottom: 20px">
        <!-- <el-radio-button :value="false">expand</el-radio-button>
        <el-radio-button :value="true">collapse</el-radio-button> -->
      </el-radio-group>
      <el-menu :default-active="$route.path" class="el-menu-vertical-demo" :collapse="isCollapse" @open="handleOpen"
        @close="handleClose" @select="selectItem">
        <el-sub-menu index="3">
          <template #title>
            <el-icon>
              <setting />
            </el-icon>
            <span>项目简介</span>
          </template>
          <!-- <el-menu-item-group>
            <el-menu-item index="/IndexMap/SystemConfig">系统配置管理</el-menu-item>
            <el-menu-item index="/IndexMap/SystemConfigAPI">系统开发指南(API)</el-menu-item>
          </el-menu-item-group> -->
        </el-sub-menu>
        <el-sub-menu index="1">
          <template #title>
            <el-icon>
              <PictureFilled />
            </el-icon>
            <span>可视化 Visualization</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/Wind">风向图</el-menu-item>
            <el-menu-item index="/Geopotential">Geopotential</el-menu-item>
            <el-menu-item index="/Humidity">湿度图 Specific humidity</el-menu-item>
            <el-menu-item index="/Temperature">温度图 Temperature</el-menu-item>
            <el-menu-item index="/Pressure">Pressure</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
        <el-sub-menu index="2">
          <template #title>
            <el-icon>
              <icon-menu />
            </el-icon>
            <span>原始数据集</span>
          </template>
          <!-- <el-menu-item-group>
            <el-sub-menu index="2-1">
              <template #title>深度学习算法</template>
              <el-menu-item index="/IndexMap/ListLogTrain">训练数据集</el-menu-item>
              <el-menu-item index="/IndexMap/ListLogInfer">测试数据集</el-menu-item>
              <el-menu-item index="/IndexMap/ListLogManage">模型管理</el-menu-item>
            </el-sub-menu>
            <el-menu-item index="/IndexMap/ListDifference">差分路损</el-menu-item>
            <el-menu-item index="/IndexMap/ListTAAOA">TAAOA</el-menu-item>
            <el-menu-item index="/IndexMap/ListTARSRP">TARSRP</el-menu-item>
          </el-menu-item-group> -->
        </el-sub-menu>


        <!-- <el-menu-item index="3" disabled>
          <el-icon>
            <document />
          </el-icon>
          <template #title>Navigator Three</template>
        </el-menu-item>
        <el-menu-item index="4" disabled>
          <el-icon>
            <setting />
          </el-icon>
          <template #title>Navigator Four</template>
        </el-menu-item> -->
      </el-menu>
    </el-aside>

  </el-container>

</template>
<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 230px;
  min-height: 700px;
}

/* #container {
  height: 100%;
  width: 100%;
  position: absolute;
} */

#top {
  width: 210px;
  /* background-color: #545c64; */
  margin-right: 1px;
  text-align: center;
  height: 60px;
}

/* .flx-center {
  display: flex;
  align-items: center;
  justify-content: center;
} */
</style>